<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/admin-header::testcase">

</head>

<body class="app sidebar-mini rtl">

<div th:replace="common/admin-sadbar::sadbar"></div>


<main class="app-content">
    <div class="app-title">
        <div>
            <h1><i class="fa fa-bug"></i> 测试报告</h1>
            <p>测试报告列表</p>
        </div>
        <ul class="app-breadcrumb breadcrumb">
            <li class="breadcrumb-item"><i class="fa fa-list fa-lg"></i></li>
            <li class="breadcrumb-item"><a href="#">报告管理</a></li>
            <li class="breadcrumb-item"><a href="#">测试报告</a></li>
        </ul>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="tile">
                <div class="tile-body">
                    <div class="offset-md-11">

                        <button class="btn btn-danger" data-toggle="modal"
                                data-target="#"><i class="fa fa-remove" aria-hidden="true"></i>批量删除
                            <!--todo 批量删除接口功能-->
                        </button>
                    </div>

                    <hr>
                    <table class="table table-hover table-bordered" style="white-space: nowrap" id="sampleTable">
                        <thead>
                        <tr>
                            <th th:class="text-center">编号</th>
                            <th th:class="text-center">名称</th>
                            <th th:class="text-center">创建时间</th>
                            <th th:class="text-center">测试用例</th>
                            <th th:class="text-center">测试集</th>
                            <th th:class="text-center">测试报告</th>
                            <th th:class="text-center">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="report:${reports}">
                            <td th:text="${report.getReportId()}" class="text-center">id</td>
                            <td th:text="${report.getReportName()}" class="text-center">name</td>
                            <td th:text="${report.getCreateTime()}" th:class="text-center">time</td>
                            <td th:text="${report.getBelongTestCase()}" th:class="text-center">testcase</td>
                            <td th:text="${report.getBelongTestSuit()}" th:class="text-center">testsuit</td>
                            <td class="text-center">
                                <a th:href="@{/test/report(id=${report.getReportId()})}"><strong>查看</strong></a>
                            </td>
                            <td class="text-center">
                                <button class="btn btn-sm btn-danger"
                                        th:onclick="deleteReport([[${report.getReportId()}]])">
                                    <i class="fa fa-trash" aria-hidden="true"></i>删除
                                </button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</main>

<div th:include="common/script::script"></div>
<script type="text/javascript">$('#sampleTable').DataTable();</script>

<script th:src="@{/static/flytest-js/report.js}"></script>
<script th:src="@{/static/flytest-js/util.js}"></script>

</body>
</html>